package com.lagou.com.lagou.homework.Modules2.item3;

/**
 * 封装一个手机卡类
 */
public class Card {
    //私有化成员变量
    private String cardClass;
    private int cardNum;
    private String name;
    private char passcd;
    private int yuee;
    private int callTime;
    private int liuliang;

    public Card() {
    }

    public Card(String cardClass, int cardNum, String name, char passcd, int yuee, int callTime, int liuliang) {
        setCardClass(cardClass);
        setCardNum(cardNum);
        setName(name);
        setPasscd(passcd);
        setYuee(yuee);
        setCallTime(callTime);
        setLiuliang(liuliang);
        /*this.passcd = passcd;
        this.yuee = yuee;
        this.callTime = callTime;
        this.liuliang = liuliang;*/
    }

    public String getCardClass() {
        return cardClass;
    }

    public void setCardClass(String cardClass) {
        this.cardClass = cardClass;
    }

    public int getCardNum() {
        return cardNum;
    }

    public void setCardNum(int cardNum) {
        this.cardNum = cardNum;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public char getPasscd() {
        return passcd;
    }

    public void setPasscd(char passcd) {
        this.passcd = passcd;
    }

    public int getYuee() {
        return yuee;
    }

    public void setYuee(int yuee) {
        this.yuee = yuee;
    }

    public int getCallTime() {
        return callTime;
    }

    public void setCallTime(int callTime) {
        if (callTime >= 0){
            this.callTime = callTime;
        }else{
            System.out.println("输入不合理");
        }

    }

    public int getLiuliang() {
        return liuliang;
    }

    public void setLiuliang(int liuliang) {
        if (liuliang >= 0){
            this.liuliang = liuliang;
        }else{
            System.out.println("输入不合理");
        }

    }
    public void show() {
        System.out.println("卡号为：" + getCardNum() + "的" + getName() + "先生/女士，您" + "剩余话费：" + getYuee());
        CardEnum ce = CardEnum.BIG;
        System.out.println("您使用的是：(" + ce.getDesc() + ")型");
    }
}
